const vns_btn_name_template = "${VNS_tag} (${VNS_num})";
const json_item = {"VNS_id":2,"VNS_tag":"Comparison","VNS_color":"#efbd9c","VNS_desc":"Comparison facilitates the explanation of similarities and differences by analyzing two or more datasets/data points. As a common means of presenting visualizations, comparison is also effective for data-driven storytelling.","VNS_num":9};
const btn_name_regex = /\$\{(.*?)\}/gm;
let m;

function get_reg_template (pairs, json_item = {}) {
    let temp_pairs = pairs + "";
    console.log("1", temp_pairs);
    temp_pairs.replace(btn_name_regex, (all_match, match_inner, i) => {
        console.log(Object.keys(json_item).indexOf(match_inner));
        if(Object.keys(json_item).indexOf(match_inner) > -1) {
            return json_item[match_inner];
        }
        return "tag_" + i;
    });
    return temp_pairs;
}

m = get_reg_template(vns_btn_name_template, json_item);
console.log("result:", m);